﻿<Window x:Class="Waf.InformationManager.EmailClient.Modules.Presentation.Views.EmailAccountsWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dd="clr-namespace:Waf.InformationManager.EmailClient.Modules.Presentation.DesignData"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    Title="Email accounts" Icon="{StaticResource InformationManagerImageSource}" Height="370" Width="550"
    d:DataContext="{d:DesignInstance dd:SampleEmailAccountsViewModel, IsDesignTimeCreatable=True}">
    
    <DockPanel>
        <ToolBar DockPanel.Dock="Top">
            <Button Command="{Binding NewAccountCommand}" ToolTip="Creates a new email account."><AccessText Text="_New account"/></Button>
            <Button Command="{Binding RemoveAccountCommand}" ToolTip="Deletes the selected email account."><AccessText Text="_Delete"/></Button>
            <Button Command="{Binding EditAccountCommand}" ToolTip="Edits the selected email account."><AccessText Text="_Edit"/></Button>
            <Button IsCancel="True" ToolTip="Close this window."><AccessText Text="_Close"/></Button>
        </ToolBar>
        
        <DataGrid x:Name="emailAccountsGrid" ItemsSource="{Binding EmailClientRoot.EmailAccounts}" SelectedItem="{Binding SelectedEmailAccount}" 
                  Background="{x:Static SystemColors.WindowBrush}" MouseDoubleClick="EmailAccountsGridMouseDoubleClick" SelectionMode="Single"
                  BorderThickness="0">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Name, Mode=OneWay}" IsReadOnly="True" Header="Name" Width="*"
                                    ElementStyle="{StaticResource TextCellElementStyle}"/>
                <DataGridTextColumn Binding="{Binding Email, Mode=OneWay}" Header="Email" IsReadOnly="True" Width="*"
                                    ElementStyle="{StaticResource TextCellElementStyle}"/>
            </DataGrid.Columns>
        </DataGrid>
    </DockPanel>
</Window>
